﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Demo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        Entities demo = new Entities();
        private void button1_Click(object sender, EventArgs e)
        {
            
            var bn = from benhnhan in demo.tb_BN_BENHNHAN
                     select benhnhan;
            dataGridViewX1.DataSource = bn;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            var benhnhan = from p in demo.tb_BN_BENHNHAN
                           where p.HOTENLOT.Contains(textBox1.Text)
                           select p;
            dataGridViewX1.DataSource = benhnhan;
        }
    }
}
